﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EcodexIntegrationSample.Forms
{
    public partial class frmObtenerTimbradoPorHash : Form, View.IfrmObtenerTimbradoPorHash
    {
        public event EventHandler onObtenerComprobantePorHash;
        public frmObtenerTimbradoPorHash()
        {
            InitializeComponent();
            var Controller = new Controllers.frmObtenerTimbradoPorHashController(this);
        }

        private void btnObtenerComprobantePorHash_Click(object sender, EventArgs e)
        {
            if (onObtenerComprobantePorHash != null)
                onObtenerComprobantePorHash(this, e);
        }

        private void frmObtenerTimbradoPorHash_Load(object sender, EventArgs e)
        {

        }

        public string RFCEmisor
        {
            get { return txtRFC.Text; }
        }

        public string HashCadenaOriginal
        {
            get { return txtHashCadena.Text; }
        }

        public string Respuesta
        {
            set { txtRespuesta.Text = value; }
        }


        public void ShowSessionError(Entity.SessionError error)
        {
            MessageBox.Show(String.Format("Status {0}: {1}", error.Status.ToString(), error.Description), "Ecodex UniTest");
        }

        public void ShowUnknownError(String message)
        {
            MessageBox.Show(String.Format("Error: {0}", message), "Ecodex UniTest");
        }

    }
}
